package com.example.demo03_mvm.db;

import androidx.room.Entity;
import androidx.room.PrimaryKey;

import com.chad.library.adapter.base.entity.MultiItemEntity;

@Entity(tableName = "kf")
public class KfEntity implements MultiItemEntity{
    @PrimaryKey(autoGenerate = true)
    private Integer id;
    private String msg;
    private int who;//发送方:0/接收方:1
    private int gid;//商品id

    public KfEntity(String msg, int who, int gid) {
        this.msg = msg;
        this.who = who;
        this.gid = gid;
    }

    public int getGid() {
        return gid;
    }

    public void setGid(int gid) {
        this.gid = gid;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getWho() {
        return who;
    }

    public void setWho(int who) {
        this.who = who;
    }

    @Override
    public String toString() {
        return "KfEntity{" +
                "id=" + id +
                ", msg='" + msg + '\'' +
                ", who=" + who +
                ", gid=" + gid +
                '}';
    }

    @Override
    public int getItemType() {
        return who;
    }
}
